package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 服务项Controller
 * */
@RestController
@RequestMapping("/member/orders/project")
public class ServiceProjectController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;
    /**
     * 分页查询护理项列表
     * */
    @GetMapping("/page")
    public TableDataInfo list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    /**
     * 根据Id查询护理项
     * */
    @GetMapping("/{id}")
    public AjaxResult getNursingProjectById (@PathVariable Integer id)
    {
        return AjaxResult.success(nursingProjectService.selectNursingProjectById(Long.valueOf(id)));
    }

}
